package com.dj.mingkong.admin.biz.controller.music;

import com.dj.mingkong.admin.biz.controller.music.vo.request.BoxMusicQueryVo;
import com.dj.mingkong.admin.biz.controller.music.vo.response.BoxMusicVo;
import com.dj.mingkong.admin.biz.service.music.BoxMusicService;
import com.dj.mingkong.common.annotation.HasRoles;
import com.dj.mingkong.common.enums.RoleEnum;
import com.dj.mingkong.common.infrastructure.base.dto.page.PageVo;
import com.dj.mingkong.common.infrastructure.base.dto.rest.RestResponse;
import com.dj.mingkong.common.util.AssertUtils;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 音乐收藏管理
 *
 * @author zenglonghui
 * @date: 2022/12/13 16:49
 */
@RestController
@RequestMapping("/box/music")
@HasRoles(RoleEnum.ADMIN)
public class BoxMusicController {
    @Resource
    private BoxMusicService boxMusicService;

    /**
     * 音乐收藏列表查询
     *
     * @param queryVo {}
     * @return BoxMusicVo
     */
    @PostMapping("/pageByVo")
    public RestResponse<PageVo<BoxMusicVo>> pageByVo(@RequestBody BoxMusicQueryVo queryVo) {
        AssertUtils.checkQueryPageVo(queryVo);
        return RestResponse.success(boxMusicService.pageByVo(queryVo));
    }
}
